interface IdIndex<T> {

    id:T;

    getId():T;

}

class Human implements IdIndex<string> {

    id:string;

    constructor(id:string) {
        this.id = id;
    }

    getId():string {
        return this.id;
    }

}

class Animal implements IdIndex<number> {
    id:number;

    constructor(id:number) {
        this.id = id;
    }

    getId():number {
        return this.id;
    }

}

class PC<T> implements IdIndex<T> {

    id:T;

    constructor(id:T) {
        this.id = id;
    }

    getId():T {
        return this.id;
    }
}

let human:Human = new Human("罗佰君");
let id1:string = human.getId();

let animal:Animal = new Animal(1);
let id2:number = animal.getId();

let pc:PC<Human> = new PC<Human>(human);
let id3:Human = pc.getId();